
#ifndef _WaveOutEngine_h
#define _WaveOutEngine_h

#include "../_SoundEngineWrapper.h"

namespace Riccsson
{
	namespace Xna
	{
		namespace Framework
		{
			namespace Audio
			{
				class _WaveOutEngine : public _SoundEngineBase
				{
					// pointer and size of the next player buffer to enqueue, and number of remaining buffers
					short* m_nextBuffer;
					unsigned m_nextSize;
					uint BufID;
					bool m_running;
					bool m_paused;
					bool m_threadRunning;
					
					uint FSourceID;

					public: _WaveOutEngine();

					public: virtual void initialize();
					public: virtual void release();

					public: virtual void submitBuffer(byte* buffer, int length);

					public: virtual void play();
					public: virtual void stop();
					public: virtual void pause();

					private: void runBuffer();
					private: Void threadPlaying();
				};
			}
		}
	}
}

#endif